//引入公共css、js
document.write("<link rel='stylesheet' type='text/css' href='css/pub-lib/bootstrap/bootstrap.min.css'>");
document.write("<script type='text/javascript' src='js/pub-lib/jquery/jquery-1.9.1.min.js'></script>");
document.write("<script type='text/javascript' src='js/pub-lib/bootstrap.min.js'></script>");

//公共工具类
CommonUtils = {
    // 注册命名空间
    // 例如 CommonUtils.regNamespace("com.app");
    regNamespace : function(name) {
        var arr = name.split(".");
        var ns = "";
        for (var i = 0; i < arr.length; i++) {
            if (i > 0)
                ns += ".";
            ns += arr[i];
            eval("if(typeof(" + ns + ") == 'undefined') " + ns
                + " = new Object();");
        }
    }
};

CommonUtils.regNamespace("com.app.common");

//常量
com.app.common.mda = {
    LOGGER_SWITCH : true,
    DEVICE_TYPE : 'pc'
};

//工具
com.app.common.util = {

    //日志输出
    log : function (message) {
        try{
            if(com.app.common.mda.LOGGER_SWITCH){
                console.log(message);
            }
        }catch(exception){
            return '日志输出异常';
        }
    }
};
